package phoenix.web.test_suites.clickandflirt.critical;

import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import phoenix.core.base.TestSuiteBase;
import phoenix.core.data_models.UserProfileDataModel.AboutMe;
import phoenix.core.data_models.UserProfileDataModel.LookingFor;
import phoenix.core.data_models.UserProfileDataModel.PaymentDetails;
import phoenix.web.test_objects.BackendTests;
import phoenix.web.test_objects.FunnelTests;
import phoenix.web.test_objects.PaymentTests;
import phoenix.web.test_objects.RegistrationTests;

/**
 * Test suite - Payment tests
 */
public class PaymentTS extends TestSuiteBase
{
	// Tests
	private final RegistrationTests registrationTests = new RegistrationTests(phoenix);
	private final BackendTests backendTests = new BackendTests(phoenix);
	private final FunnelTests funnelTests = new FunnelTests(phoenix);
	private final PaymentTests paymentTests = new PaymentTests(phoenix);

	@DataProvider
	public Object[][] registrationDataMale()
	{
		return registrationTests.dataProviders.registrationDataMale();
	}

	@DataProvider
	public Object[][] funnelData()
	{
		return funnelTests.dataProviders.funnelData();
	}

	@DataProvider
	public Object[][] paymentData()
	{
		return paymentTests.dataProviders.paymentData();
	}

	@Test(dataProvider = "registrationDataMale", groups = { "registration" }, priority = 1, enabled = true)
	public void registrationTest(String p_userGender, String p_userEmail, String p_userPassword, String p_userBirthDay, String p_userBirthMonth,
			String p_userBirthYear)
	{
		registrationTests.registrationTest(p_userGender, p_userEmail, p_userPassword, p_userBirthDay, p_userBirthMonth, p_userBirthYear);
	}

	@Test(dependsOnMethods = { "registrationTest" }, groups = { "registration" }, priority = 2, enabled = true)
	public void getUserDataTest()
	{
		backendTests.getUserDataTest(testUser().getEmail());
	}

	@Test(dependsOnMethods = { "getUserDataTest" }, groups = { "registration" }, priority = 4, enabled = true)
	public void confirmationTest()
	{
		funnelTests.confirmationTest();
	}

	@Test(dependsOnGroups = { "registration" }, dataProvider = "funnelData", groups = { "funnel" }, priority = 5, enabled = true)
	public void funnelMaleTest(String p_screenname, LookingFor p_looking, AboutMe p_about)
	{
		funnelTests.funnelTest(p_screenname, p_looking, p_about);
	}

	@Test(dependsOnGroups = { "registration" }, dataProvider = "paymentData", groups = { "payment" }, priority = 6, enabled = true)
	public void paymentPackageTest(PaymentDetails p_details, boolean p_expected)
	{
		paymentTests.paymentPackageTest(p_details, p_expected);
	}

	@Test(dependsOnMethods = { "paymentPackageTest" }, dataProvider = "paymentData", groups = { "payment" }, priority = 7, enabled = true)
	public void paymentFeaturesTest(PaymentDetails p_details, boolean p_expected)
	{
		paymentTests.paymentFeaturesTest(p_details, p_expected);
	}
}